#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include "Session.hpp"

std::string GetMonthName(int month)
{
    std::vector<std::string> months = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
    return months[month - 1];
}

std::string GetWeekName(int day)
{
    std::vector<std::string> weeks = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
    return weeks[day - 1];
}

void AddSession(session_ptr s, std::unique_ptr<SessionManager> &manger)
{
    manger->AddSession(s);
}

void Login(std::unique_ptr<SessionManager>& manager)
{
    session_ptr s = std::make_shared<Session>("user-123", "logined");
    AddSession(s, manager);
}

int main() 
{
    auto manager = std::unique_ptr<SessionManager>(new SessionManager());
    manager->DebugPrint();

    int cnt = 1;
    while(true)
    {
        if(cnt == 1)
        {
            Login(manager);
        }
        cnt++;
        if (cnt > 1)
            manager->DebugPrint();
        sleep(2);
    }
    return 0;
}